#include "LinkQueue.h" //约瑟夫环
#include <iostream>

int main()
{
    LinkQueue q;
    for (long i = 1; i <= 13; i++)
    {
        q.Push((void *)i);
    }

    int count = 0;
    while (q.Size() > 1)
    {

        long num = (long)*q.GetFront();
        q.Pop();
        count++;
        if (count == 3)
        {
            std::cout << num << "被杀死!\n";
            count = 0;
        }
        else
            q.Push((void *)num);
    }

    std::cout << (long)*q.GetFront() << "活了下来!" << std::endl;
    return 0;
}
